package com.bao1;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component("mystudent")
public class student {
    @Value("${name123}")
    private String name;
    @Value("22")
    private int age;
    @Autowired
    @Qualifier("myschool")
    private school school;
    public void setName(String name) {
        this.name = name;
    }

    public void setAge(int age) {
        System.out.println("set");
        this.age = age;
    }

    public student() {
    }

    @Override
    public String toString() {
        return "student{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", school=" + school +
                '}';
    }
}
